import { createPinia } from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import { setProgressInstance } from '@/api/index.js'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Vue3Progress from 'vue3-progress'

const progressOptions = {
  position: 'fixed',
  height: '3px'
}
const app = createApp(App)
const pinia = createPinia()

app.use(Vue3Progress, progressOptions).use(ElementPlus).use(router).use(pinia)

// Provide the progress instance globally
app.provide('$progress', app.config.globalProperties.$progress)
setProgressInstance(app.config.globalProperties.$progress)

// Mount the app
app.mount('#app')
